package com.pvdnc.riru;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.content.pm.ApplicationInfo;

import java.lang.reflect.Method;
@SuppressLint({"PrivateApi","DiscouragedPrivateApi"})
public class ContextUtils {
    public static Application get() {
        try {
            Class<?> atClass = Class.forName("android.app.ActivityThread");
            Method gaMethod = atClass.getDeclaredMethod("currentApplication");
            gaMethod.setAccessible(true);
            return (Application) gaMethod.invoke(null);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}
